package com.xbongbong.saas.domain.dao;

import com.xbongbong.pro.knowledge.base.pojo.CountPojo;
import com.xbongbong.saas.domain.entity.KnowledgeTagEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface KnowledgeTagDao {
    Integer insert(KnowledgeTagEntity entity);

    void insertBatch(List<KnowledgeTagEntity> list);

    KnowledgeTagEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer update(KnowledgeTagEntity entity);

    List<KnowledgeTagEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    List<KnowledgeTagEntity> getByTagIdList(@Param("tagIdList") List<Long> tagIdList, @Param("corpid") String corpid);

    void move2RecycleBin(@Param("idList") List<Long> idList, @Param("corpid") String corpid);

    void deleteById(@Param("id") Long id, @Param("corpid") String corpid);

    void deleteByIdList(@Param("idList") List<Long> idList, @Param("corpid") String corpid);

    void sort(@Param("param") Map<String, Object> param, @Param("sortMap") Map<Long, Long> sortMap);

    List<CountPojo> getSameCount(@Param("nameList") List<String> nameList, @Param("corpid") String corpid);

    void editSameCount(@Param("list") List<CountPojo> list, @Param("corpid") String corpid);
}